<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php
/*	$user		= JFactory::getUser();
	$app		= JFactory::getApplication();
	$userId		= $user->get('id');
	$listOrder	= $this->escape($this->state->get('list.ordering'));
	$listDirn	= $this->escape($this->state->get('list.direction'));
	$ordering 	= ($listOrder == 'a.lft');
	$canOrder	= $user->authorise('core.edit.state',	'com_menus');
	$saveOrder 	= ($listOrder == 'a.lft' && $listDirn == 'asc');*/
?>

<form action="<?php echo JRoute::_('index.php?option=com_charts');?>" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>			
			<th>
				<?php echo JText::_( 'Nombre' ); ?>
			</th>
			<th width="8%">
				<?php //echo JHTML::_('grid.sort',   'Position', $row->ordering, @$lists['order_Dir'], @$lists['order'] ); ?>
				<?php echo JHTML::_('grid.order',  $this->items ); ?>
			</th>			
		</tr>
	</thead>
		
	<?php
	$n=sizeof($this->items);
	foreach($this->items as $key=>$row){
		$checked 	= JHTML::_('grid.id',   $key, $row['id'] );
		$link 		= JRoute::_( 'index.php?option=com_charts&controller=chart&task=edit&cid[]='. $row['id'] );
		?>
		<tr class="<?php echo "row".$row['id']; ?>">
			<td>
				<?php echo $key; ?>
			</td>
			<td>
				<?php echo $checked; ?>
			</td>
			<td>
				<?php echo str_repeat('<span class="gi">|&mdash;</span>', $row['nivel']) ?><a href="<?php echo $link; ?>"><?php echo $row['nombre']; ?></a>
			</td>
			<td class="order">
			    <span><?php echo $this->pagination->orderUpIcon( $key, ($key > 0), 'orderup', 'Move Up'); ?></span>
				<span><?php echo $this->pagination->orderDownIcon( $key, $n, ($key < $n ), 'orderdown', 'Move Down'); ?></span>
				<input type="text" name="order[]" size="5" value="<?php echo $row['ordering']; ?>" class="text_area" style="text-align: center" />
			</td>			
		</tr>
		
		<?php
	}
	?>
	</table>
</div>

<input type="hidden" name="option" value="com_charts" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="charts" />
</form>
